<template>
  <view class="container">
    <view class="header">溯源信息</view>
    <view class="info-section">
	  <view class="image-preview">
	    <image :src="imageSrc" class="image-uploaded" />
	  </view>	
      <view class="info-item">
        <text class="label">产品名称：</text>
        <text class="value">示例产品</text>
      </view>
      <view class="info-item">
        <text class="label">生产日期：</text>
        <text class="value">2025-05-28</text>
      </view>
      <view class="info-item">
        <text class="label">生产批次：</text>
        <text class="value">20250528-001</text>
      </view>
      <view class="info-item">
        <text class="label">产地：</text>
        <text class="value">中国</text>
      </view>
      <view class="info-item">
        <text class="label">保质期：</text>
        <text class="value">12个月</text>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      imageSrc: ''
    };
  },
  onLoad() {
    this.imageSrc = uni.getStorageSync('imageSrc'); // 获取上传的图片地址
  }
};
</script>

<style scoped>
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}
.header {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
}
.info-section {
  width: 90%;
  margin-bottom: 20px;
}
.info-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.label {
  font-weight: bold;
}
.value {
  color: #555;
}
.image-preview {
  width: 100%;
  display: flex;
  justify-content: center;
}
.image-uploaded {
  width: 200px;
  height: 200px;
  border-radius: 10px;
}
</style>